/*
 *   SlimPlayer Copyright (c) 2006 Koelec
 *
 *   This file is part of SlimPlayer plugin for SageTv.
 *
 *   Slimplayer is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   Slimplayer is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with SoftSqueeze; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
package nl.cmkprojects.sage.web;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author Chris
 * 
 *         To change the template for this generated type comment go to Window -
 *         Preferences - Java - Code Generation - Code and Comments
 */
public class ArtistInfo {
  private String name;
  private String bio;
  private String pictureURL;
  private long timestamp = System.currentTimeMillis();;
  private ArtistNews news = new ArtistNews();
  private List<String> photos = new ArrayList<String>();
  private int photoIndex = 0;
  private long photoInterval = 10000;
  private long lastPhotoTimestamp = System.currentTimeMillis();

  public long getTimestamp() {
    return timestamp;
  }

  public void setPhotos(List<String> photos) {
    this.photos = photos;
  }

  public List<String> getPhotos() {
    return photos;
  }

  public void setPhotoSpeed(int millis) {
    photoInterval = millis;
  }

  public String getNextPhoto() {
    String result = "";
    if (photoIndex == photos.size()) {
      photoIndex = 0;
    }
    if (photos.size() > 0) {
      result = photos.get(photoIndex);
      if (System.currentTimeMillis() > lastPhotoTimestamp + photoInterval) {
        photoIndex++;
        lastPhotoTimestamp = System.currentTimeMillis();
      }
    }
    return result;
  }

  public ArtistNews getNews() {
    return news;
  }

  public void setNews(ArtistNews news) {
    this.news = news;
  }

  /**
   * @return Returns the bio.
   */
  public String getBio() {
    return bio;
  }

  /**
   * @param bio
   *          The bio to set.
   */
  public void setBio(String bio) {
    this.bio = bio;
  }

  /**
   * @return Returns the name.
   */
  public String getName() {
    return name;
  }

  /**
   * @param name
   *          The name to set.
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * @return Returns the pictureURL.
   */
  public String getPictureURL() {
    return pictureURL;
  }

  /**
   * @param pictureURL
   *          The pictureURL to set.
   */
  public void setPictureURL(String pictureURL) {
    this.pictureURL = pictureURL;
  }

  @Override
  public String toString() {
    // TODO Auto-generated method stub
    return ToStringBuilder.reflectionToString(this);
  }

}
